<!DOCTYPE html>
{% load i18n %}
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="shortcut icon" type="image/png" href="/static/favicon.ico"/>
    <link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
    {% include 'show/link.html' %}
    <script src="/static/lib/art-template/web-ie-compatible/es5-shim.min.js"></script>
    <script src="/static/lib/art-template/web-ie-compatible/es5-sham.min.js"></script>
    <script src="/static/lib/art-template/web-ie-compatible/json3.min.js"></script>
    <script src="/static/lib/art-template/template-web.js"></script>

    <title>{% trans '实名认证' %}</title>
    <style>
    </style>
    <script>
        $(document).ready(function() {
            get_cert_info()
        })

        function get_cert_info() {
            $.post("{% url 'get_cert_info'%}",
            {},
            function(obj) {
                info = obj
                info.name = info.name
                info.gender = get_gender(info.gender)
                info.national = get_national(info.national)
                info.address = info.address
                info.id_type = get_id_type(info.id_type)
                info.id_number = info.id_number

                var data = {
                    jsonobj: obj,
                }
                var html = template('temp_cert_info', data);
                document.getElementById('show_cert_info').innerHTML = html;
                init_balances_collapse()
            });
        }

        function get_gender(gender) {
            if (gender == 1) {
                return '{% trans "男" %}'
            } else if (gender == 2) {
                return '{% trans "女" %}'
            } else {
                return ''
            }
        }

        function get_id_type(gender) {
            if (gender == 1) {
                return '{% trans "身份证" %}'
            } else {
                return ''
            }
        }

        function get_national(national) {
            if (national == 'hk') {
                return '{% trans "中国香港" %}'
            } else if (national == 'mo') {
                return '{% trans "中国澳门" %}'
            } else if (national == 'tw') {
                return '{% trans "中国台湾" %}'
            } else if (national == 'cn') {
                return '{% trans "中国大陆" %}'
            } else if (national == 'jp') {
                return '{% trans "日本" %}'
            } else if (national == 'kr') {
                return '{% trans "韩国" %}'
            } else if (national == 'au') {
                return '{% trans "澳大利亚" %}'
            } else if (national == 'ca') {
                return '{% trans "加拿大" %}'
            } else if (national == 'us') {
                return '{% trans "美国" %}'
            } else if (national == 'sg') {
                return '{% trans "新加坡" %}'
            } else if (national == 'nz') {
                return '{% trans "新西兰" %}'
            } else if (national == 'de') {
                return '{% trans "德国" %}'
            } else if (national == 'fr') {
                return '{% trans "法国" %}'
            } else if (national == 'uk') {
                return '{% trans "英国" %}'
            } else if (national == 'ie') {
                return '{% trans "爱尔兰" %}'
            } else if (national == 'ru') {
                return '{% trans "俄罗斯" %}'
            } else if (national == 'es') {
                return '{% trans "西班牙" %}'
            } else if (national == 'pt') {
                return '{% trans "葡萄牙" %}'
            } else {
                return '{% trans "其他国家和地区请联系客服增加" %}'
            }
        }
    </script>
    <script id="temp_cert_info" type="text/html">
        <% var info = jsonobj %>
        <table width="300" border="1">
        <caption>{% trans '个人信息仅供展示,不可更改,如需修改,请联系客服' %}</caption>
            <tr>
              　<td>{% trans '姓名' %}</td>
                <td><%=info.name%></td>
            </tr>
            <tr>
              　<td>{% trans '性别' %}</td>
                <td><%=info.gender%></td>
            </tr>
            <tr>
              　<td>{% trans '证件签发国家(地区)' %}</td>
                <td><%=info.national%></td>
            </tr>
            <tr>
              　<td>{% trans '证件类型' %}</td>
                <td><%=info.id_type%></td>
            </tr>
            <tr>
              　<td>{% trans '证件号码' %}</td>
                <td><%=info.id_number%></td>
            </tr>
            <tr>
              　<td>{% trans '地址' %}</td>
                <td><%=info.address%></td>
            </tr>
        </table>
    </script>
</head>

<body>
    {% include 'show/top_bar.html' %}
    <br>
    <div class="main_body">
        <div class="container">
            {% include 'userinfo/sider.html' %}
            <div id="show_cert_info"> </div>
        </div>
    </div>
    {% include 'show/footer.html' %}
</body>
</html>
